home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / elementl / source / loading.dir / 00002_Animate Ball.ls < prev    next >
Encoding:
Text File  |  1996-11-11  |  1.7 KB  |  56 lines

  1. on exitFrame
  2.   global gMagnitude, gGreyBack, gX
  3.   repeat while gMagnitude > 98
  4.     repeat with count = 0 to 499
  5.       if rollOver(4) = 0 then
  6.         set the foreColor of sprite 1 to 0
  7.         updateStage()
  8.         go(2)
  9.         abort()
  10.         next repeat
  11.       end if
  12.       set gMagnitude to gMagnitude * 0.998
  13.       set the locH of sprite 1 to integer(the locH of sprite 2 + (gMagnitude * cos(count * ((2 * PI) + gX))))
  14.       set the locV of sprite 1 to integer(the locV of sprite 2 + (gMagnitude * sin(count * ((2 * PI) + gX))))
  15.       set the foreColor of sprite 1 to the foreColor of sprite 1 + 1
  16.       if gGreyBack = 1 then
  17.         set the foreColor of sprite 2 to 255
  18.         set gGreyBack to 0
  19.       else
  20.         set the foreColor of sprite 2 to 244
  21.         set gGreyBack to 1
  22.       end if
  23.       updateStage()
  24.     end repeat
  25.   end repeat
  26.   set gMagnitude to 100
  27.   repeat while gMagnitude > 98
  28.     if rollOver(4) = 0 then
  29.       go(2)
  30.       abort()
  31.       next repeat
  32.     end if
  33.     repeat with count = 0 to 499
  34.       if rollOver(4) = 0 then
  35.         go(2)
  36.         abort()
  37.         next repeat
  38.       end if
  39.       set gMagnitude to gMagnitude * 0.998
  40.       set the locH of sprite 1 to integer(the locH of sprite 2 + (gMagnitude * cos(count * ((2 * PI) + gX))))
  41.       set the locV of sprite 1 to integer(the locV of sprite 2 + (gMagnitude * sin(count * ((2 * PI) + gX))))
  42.       set the foreColor of sprite 1 to 0
  43.       if gGreyBack = 1 then
  44.         set the foreColor of sprite 2 to 255
  45.         set gGreyBack to 0
  46.       else
  47.         set the foreColor of sprite 2 to 244
  48.         set gGreyBack to 1
  49.       end if
  50.       updateStage()
  51.     end repeat
  52.   end repeat
  53.   set gMagnitude to 100
  54.   go(2)
  55. end
  56.